﻿using System;
using System.Web;

public partial class userControls_ctrl_userProfile : System.Web.UI.UserControl
{
    private Bintje.User m_user;
    /*
    public int? UserId
    {
        get
        {
            return (hdnMyProfile.Value != "") ? int.Parse(hdnMyProfile.Value) : 0;
        }
        set
        {
            hdnMyProfile.Value = value.ToString();
        }
    }
    */
    public Bintje.User User
    {
        set { m_user = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (null != m_user)
            {
                imgUser.ImageUrl = m_user.ImageUrl;
                if (string.IsNullOrEmpty(imgUser.ImageUrl))
                {
                    imgUser.ImageUrl = string.Format("~/sitefiles/Get-Thumbnail.aspx?f={0}&w=85&h=85", "~/images/users/anon.JPG");
                }

                lblUsername.Text = m_user.NickName;
                if (lblUsername.Text.Trim() == "")
                    lblUsername.Text = m_user.Login;
                ltrUsername.Text = m_user.NickName + "'s profile";
            }
        }
    }
}
